package com.itheima.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.dao.MemberMapper;
import com.itheima.entity.Result;
import com.itheima.pojo.LoginInfo;
import com.itheima.pojo.Member;
import com.itheima.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @description:
 * @author: dalao
 * @date: 2020/4/12-21:45
 * @Version: 1.0.0
 */
@Service(interfaceClass = MemberService.class)
@Transactional
public class MemberServiceImpl implements MemberService {
    @Autowired
    private MemberMapper memberMapper;


    @Override
    public Member findById(String telephone) {
//        根据号码查询用户
        return memberMapper.findByTelephone(telephone);
    }

    @Override
    public Member add(Member member) {
//        添加用户
        memberMapper.add(member);
        return member;
    }

    @Override
    public int findCountByAge(HashMap<String, String> ageMap) {
        return memberMapper.findCountByAge(ageMap);
    }

    @Override
    public List<Map> getCountsBySex() {
        return memberMapper.getCountsBySex();
    }
}
